#include "stdafx.h"
#include <string>
#include <vector>

bool ends_with(std::string const & value, std::string const & ending)
{
	if (ending.size() > value.size()) return false;
	return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
}

void filterList(std::vector<std::string>& list){
	std::vector<std::string>::iterator iter;
	for (iter = list.begin(); iter != list.end();) {
		if (!ends_with(*iter, ".jpg") && !ends_with(*iter, ".png"))
			iter = list.erase(iter);
		else
			++iter;
	}
}

